#ifndef LISTWIDGET_H
#define LISTWIDGET_H

#include<QListWidget>
#include<QMenu>
#include<QPointer>
#include<QString>
#include<QStringList>

class Song;
class ListWidgetWorker;
class QDragMoveEvent;

class ListWidget: public QListWidget{
Q_OBJECT
public:
	ListWidget(QWidget *parent = 0);
	~ListWidget();
	
	virtual void dragEnterEvent ( QDragEnterEvent * event );
	virtual void dragMoveEvent(QDragMoveEvent*);
	virtual void dropEvent ( QDropEvent * event );
	void addMedia(const QStringList &media);
signals:
	void addSong(QPointer<Song> song, short int index);
	void requestedEditMetadata(QList<QString> songPaths);
	void removeSongs(QList<short int> indices);
private slots:
	void slotAddSong(Song* song);
	void slotWorkerFinished();
	void slotEditMetadata();
	void slotRemoveFromPlaylist();
protected:
	void mousePressEvent(QMouseEvent *event);
private:
	void droppedFile(QString path);
	void droppedDir(QString path);
	
	static void filesEdited(void *obj, QList<QString> filepaths);
	void filesEdited(QList<QString> filepaths);
	
	ListWidgetWorker *m_worker;
};

#endif
